package com.wetao.testrxjava;

import android.app.Application;

import com.wetao.testrxjava.dagger.BaseComponent;
import com.wetao.testrxjava.dagger.BaseModule;
import com.wetao.testrxjava.dagger.DaggerBaseComponent;

public class MyApplication extends Application {
    private BaseComponent baseComponent;
    @Override
    public void onCreate() {
        super.onCreate();
        //因为在整个App生命周期内都只有一个Application实例,所以其中的BaseComponent实例也不会变.我们自定义一个MyApplication类
        baseComponent = DaggerBaseComponent.builder().baseModule(new BaseModule()).build();
    }

    public BaseComponent getBaseComponent() {
        return baseComponent;
    }
}

